#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>

using namespace std;

class Date
{
    friend istream& operator>>(istream& in, Date& d);

public:
    Date(int year = 1, int month = 1, int day = 1)
    {
        _year = year;
        _month = month;
        _day = day;
    }
    int GetMonthDay(int year, int month)
    {
        static int days[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
        if (month == 2 && ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0)))
        {
            return 29;
        }
        return days[month];
    }
    bool operator>(const Date& d)
    {
        if (_year > d._year
            || (_year == d._year && _month > d._month)
            || (_year == d._year && _month == d._month && _day > d._day))
        {
            return true;
        }
        else
        {
            return false;
        }
    }
    bool operator!=(const Date& d)
    {
        return _year != d._year
            || _month != d._month
            || _day != d._day;
    }
    Date& operator+=(int day)
    {
        _day += day;
        while (_day > GetMonthDay(_year, _month))
        {
            _day -= GetMonthDay(_year, _month);
            ++_month;
            if (_month == 13)
            {
                _month = 1;
                _year++;
            }
        }
        return *this;
    }
    int operator-(const Date& d)
    {
        Date max = *this;
        Date min = d;
        int flag = 1;
        if (min > max)
        {
            max = d;
            min = *this;
        }
        int tmp = 1;
        while (min != max)
        {
            min += 1;
            tmp += 1;
        }
        return tmp;
    }

    int _year;
    int _month;
    int _day;
};
istream& operator>>(istream& in, Date& d)
{
    scanf("%04d", &d._year);
    scanf("%02d", &d._month);
    scanf("%02d", &d._day);
    return in;
}
int main()
{
    Date d1, d2;
    int year1, month1, day1;
    int year2, month2, day2;
    int flag = 1;
    while (flag)
    {
        cin >> d1 >> d2;
        cout << (d1 - d2) << endl;
        flag--;
    }
    return 0;
}

/*int main()
{
    Date d1,d2;
    int year1, month1, day1;
    int year2, month2, day2;
    while(scanf("%04d%02d%02d\n%04d%02d%02d", &year1, &month1, &day1, &year2, &month2, &day2) != EOF)
    {
        d1._year=year1;
        d1._month=month1;
        d1._day=day1;
        d2._year=year2;
        d2._month=month2;
        d2._day=day2;
        cout<<(d1-d2)<<endl;
    }
    return 0;
}*/